package com.aaa.controller.mht;

import com.aaa.entity.LayData;
import com.aaa.entity.mht.MhtAnswer;
import com.aaa.service.mht.MhtAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("mhtAnswer")
public class MhtAnswerController {
    @Autowired
    private MhtAnswerService mhtAnswerService;

    /**
     * 添加测试的答案信息
     * @param details
     * @return
     */
    @PostMapping("addAnswer")
    @ResponseBody
    public LayData addRecordAnswer(@RequestBody List<MhtAnswer> details){
        System.out.println("mhtAnswer = " + details);
        Boolean isno = mhtAnswerService.addAnswer(details);
        return new LayData(isno);
    }
}
